package Fish;
//User Charecter 
import javax.swing.JLabel;
import javax.swing.SwingConstants;

import javax.swing.ImageIcon;

public class Character extends Fish {
	
	private int damage;

	public int getDamage() {
		return damage;
	}

	public void setDamage(int damage) {
		this.damage = damage;
	}
	public Character(int count, int damage) {
		super(count, damage);
		
		super.icon = new ImageIcon("images/scubadiver.png");
		super.label = new JLabel("",icon, SwingConstants.LEFT);
		
		super.setX(20);
		super.setY(200);
		
		hp=3;
		
		label.setSize(300,200);
		super.setHeight(200);
		super.setWidth(300);
		label.setLocation(20,200);
		
		// TODO Auto-generated constructor stub
	}
	public void crash(Fish fish){
		if(fish.getX()-10 < super.getX() && fish.getX()+fish.getWidth()+10 > super.getX() &&
			fish.getY()-fish.getHeight()-10 < super.getY() && fish.getY()+10 > super.getY()){
			super.setCount(super.getCount()-1);
			fish.visible=false;
			fish.setCount(fish.hp);
			fish.setY(Math.random()*600);
			fish.setX(1300);
		}
	}
}
